<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>第一个程序</title>
    <style>
      p {
        font-family: serif;
        text-align: center;
        border: 2px solid rgba(0, 0, 200, 0.6);
        /* background: rgba(0, 0, 200, 0.3); */
        color: rgba(0, 0, 200, 0.6);
        box-shadow: 1px 1px 2px rgba(0, 0, 200, 0.4);
        border-radius: 10px;
        padding: 3px 10px;
        display: inline-block;
        cursor: pointer;
      }
      span {
          color:  red;
      }
    </style>
  </head>
  <body>
    <p>Hello,<span>World</span>!</p>
    <h1>标题1</h1>
    <h2>标题2</h2>
    <h3>标题3</h3>
    <h4>标题4</h4>
    <h5>标题5</h5>
    <h6>标题6</h6>
    <script>
        var eleP = document.querySelector('p');
        var eleSpan = document.querySelector('span');
        eleP.addEventListener('click', function() {
            var name = prompt('请输入您的名字：');
            eleSpan.textContent = name;
        });

    </script>
  </body>
</html>
